<?php

namespace app\common\validate;

use think\Validate;

class DriverInfo extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'user_id'=>'require',
        'name'=>'require|length:2,20',
        'id_no'=>'require|length:18',
        'mobile'=>'require',
        'car_color'=>'require',
        'car_model'=>'require',
        'car_no'=>'require|length:7,10',
        'driver_license_front'=>'require',
        'driver_license_back'=>'require',
        'car_license_front'=>'require',
        'car_license_back'=>'require',
        'car_img_front'=>'require',
        'car_img_inside'=>'require',
        'online_drive_license'=>'',
        'online_transport_license'=>''
    ];

    /**
     * 提示消息.
     */
    protected $message = [
    ];

    /**
     * 字段描述.
     */
    protected $field = [
        'user_id'=>'用户id',
        'name'=>'姓名',
        'id_no'=>'身份证号',
        'mobile'=>'联系电话',
        'car_color'=>'车辆颜色',
        'car_model'=>'车辆型号',
        'car_no'=>'车牌号码',
        'driver_license_front'=>'驾驶证正面照片',
        'driver_license_back'=>'驾驶证背面照片',
        'car_license_front'=>'行驶证正面照片',
        'car_license_back'=>'行驶证背面照片',
        'car_img_front'=>'车辆前脸照片',
        'car_img_inside'=>'车辆内部照片',
        'online_drive_license'=>'网约车驾驶证',
        'online_transport_license'=>'网约车运输证'
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
        'apply'=> ['user_id','name','id_no','mobile','car_color','car_model','car_no',
            'driver_license_front'=>'require','driver_license_back', 'car_license_front', 'car_license_back', 'car_img_front', 'car_img_inside'],
    ];
    
}
